package com.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author 杨冰清
 * @Date 21:08
 * @Description 商品表
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Product {
    /**
     * 商品编号
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("id")
    private Integer id;
    /**
     * 商品名称
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("name")
    private String name;
    /**
     * 商品图片
     **/
    @JsonProperty("image")
    private String image;
    /**
     * 商品详情
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("detail")
    private String detail;
    /**
     * 商品分类编号
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("category_id")
    private Integer categoryId;
    /**
     * 商品价格-单位-元
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("price")
    private BigDecimal price;
    /**
     * 库存
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("stock")
    private Integer stock;
    /**
     * 商品上架状态-0代表下架-1代表上架
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("status")
    private Integer status;
    /**
     * 创建时间
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty("creat_time")
    private Date createTime;
    /**
     * 更新时间
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty("update_time")
    private Date updateTime;

    Category category;
}
